home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_truckmove.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  84 lines

  1. # Jones 3D Cog Script
  2. #
  3. # Riv_TruckMove.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # =======================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     entered       
  14.     
  15.     thing       truck
  16.     
  17.     thing       t_Ghost0
  18.     thing       t_Ghost1
  19.     
  20.     sector      sec_TrigSound
  21.     sector      trigger0
  22.     
  23.     sound       snd_Engine=jep_reverse_loop.WAV     local
  24.     
  25.     material    mat_Wheel=obj_a_truck_tire.mat      local
  26.     
  27.     int         done=0      local
  28.     int         n_pos=0     local
  29.     int         playing=0   local
  30.     int         running     local
  31.     
  32. end
  33.  
  34. # =======================================================================================
  35.  
  36. code
  37.  
  38. startup:
  39.  
  40.     SetCollideType(truck, 0);
  41.  
  42.     return;
  43.  
  44. # =======================================================================================
  45.  
  46. entered:
  47.  
  48.     if((GetSenderRef() == sec_TrigSound) && (playing == 0))
  49.     {
  50.         playing = 1;
  51.         running = PlaySoundThing(snd_Engine, truck, 1.0, 8, 20,  0x0081);
  52.     }
  53.     
  54.     if((GetSenderRef() == trigger0) && (done == 0))
  55.     {
  56.         done = 1;
  57.         
  58.         # prepare the truck
  59.         ClearThingFlags(truck, 0x80000);    # show
  60.         #SetPhysicsFlags(truck, 0x10);       # align to surface
  61.         materialanim(mat_Wheel, 10, 1);
  62.         
  63.         Sleep(0.01);
  64.         
  65.         AISetMoveSpeed(truck, 4.0);
  66.         AISetLookThing(truck, t_Ghost0);
  67.         AISetMoveThing(truck, t_Ghost0, 0);
  68.         Sleep(3.0);
  69.         AISetLookThing(truck, t_Ghost1);
  70.         AISetMoveThing(truck, t_Ghost1, 1);
  71.         
  72.         AIWaitForStop(truck);
  73.         
  74.         DestroyThing(truck);
  75.         StopSound(running, 2.0);
  76.     }
  77.                 
  78.     return; 
  79.  
  80. # =======================================================================================
  81.  
  82. end
  83.     
  84.